package com.autumn.zero.authorization.entitys.users.querys;

import javax.persistence.Table;

import com.autumn.mybatis.mapper.annotation.ViewTable;
import com.autumn.zero.authorization.entitys.users.User;

/**
 * 用户角色查询
 * 
 * @author 杨昌国 2018-12-07 15:03:39
 */
@Table
@ViewTable(UserByRoleQuery.QUERY_COMMAND_TEXT)
public class UserByRoleQuery extends User {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3109977005847586527L;
	
	/**
	 * 
	 */
	static final String QUERY_COMMAND_TEXT = "SELECT a.id,b.role_id,a.user_name,a.nick_name,a.phone_number,a.email_address,"
			+ "a.sex,a.head_portrait_path,a.birthday,a.status,a.is_sys_user,a.gmt_create,a.gmt_modified"
			+ " FROM sys_user AS a INNER JOIN sys_user_role AS b on a.id = b.user_id";
	
	/**
	 * 字段 roleId
	 */
	public static final String FILED_ROLE_ID = "roleId";
	
	/**
	 * 角色Id
	 */	
	private Long roleId;
	
	/**
	 * 获取角色Id
	 * 
	 * @return
	 */
	public Long getRoleId() {
		return roleId;
	}

	/**
	 * 设置角色Id
	 * 
	 * @param roleId 角色Id
	 */
	public void setRoleId(Long roleId) {
		this.roleId = roleId;
	}
}
